import {
	defineConfig
} from 'vite';
import {
	fileURLToPath
} from "url";
import uni from '@dcloudio/vite-plugin-uni';

export default defineConfig({
	plugins: [
		uni(),
	],
	resolve: {
		alias: {
			"@": fileURLToPath(new URL("./src", import.meta.url)),
		},
	},
	server: {
		port: 5173,
		proxy: {
			'/api': {
				target: 'http://localhost:8081',
				changeOrigin: true,
				rewrite: (path) => path.replace(/^\/api/, '/api'),
			},
		},
	},
});